import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/api': {
        target: 'https://open.feishu.cn/',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      },
      "/oss": {
        target: 'http://localhost:8991/',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/oss/, '')
      }
      // "/token": {
      //   target: 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
      //   changeOrigin: true,
      //   rewrite: path => path.replace(/^\/token/, '')
      // },
      // "/api2": {
      //   target: 'https://open.feishu.cn/open-apis/speech_to_text/v1/speech/stream_recognize',
      //   changeOrigin: true,
      //   rewrite: path => path.replace(/^\/api2/, '')
      // }
    }
  }
})
